
<div class="grid-content grid-100">
    <form class="grid-100 grid-parent" novalidate name="editForm" ng-submit="editForm.$valid && submit()">
        <div class="grid-parent grid-100 container">
            <h1 class="section-label pull-left">{{formTitle}}</h1>
            <hr>
        </div>

        <div class="grid-parent grid-100 container">
 
            <div class="grid-25">
                <label class="label-input">Item</label>
                <input-validation-message field="itemSpecId" form="editForm"></input-validation-message>
                <itemspec-auto-complete name="itemSpecId" ng-model="locationItem.itemSpecId" name="itemSpec" 
                    allow-clear="true" required />
            </div>

        </div>


        <div class="grid-parent grid-100 container" style="margin-top:30px;">
            <button type="button" class="grid-10 ripplelink pull-right" ng-click="selectLocation()">Add Location
            </button>
        </div>
        <div class="grid-parent grid-100 container">
            <table class="table">
                <thead>
                    <tr role="row">
                        <th> Name</th>
                        <th> Floor</th>
                        <th> Parent Id</th>
                        <th> Type</th>
                        <th> Location Group</th>
                        <th> Pick Strategy Weight</th>
                        <th> Support Pick Type</th>
                        <th> Support Equipments</th>
                        <th> Sub Type</th>
                        <th> Max Size</th>
                        <th> Reserve Entry Id</th>
                        <th> Occupy Entry Id</th>
                        <th> Tenant </th>
                        <th> Sequence </th>
                        <th> Status</th>
                        <th> Action</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="location in locationsView track by $index">
                        <td>{{location.name}}</a>
                        </td>
                        <td>{{location.floor}}</td>
                        <td>{{location.parentInfo.name}}</td>
                        <td>{{location.type}}</td>
                        <td>{{location.itemGroupName}}</td>
                        <td>{{location.pickStrategyWeight}}</td>
                        <td>{{location.supportPickType}}</td>
                        <td>
                            <span ng-repeat="supportEquipment in location.supportEquipments">
                                {{supportEquipment}}&nbsp;
                            </span>
                        </td>
                        <td>{{location.subType}}</td>
                        <td>{{location.maxSize}}</td>
                        <td>{{location.reserveEntryId}}</td>
                        <td>{{location.occupyEntryId}}</td>
                        <td>{{location.tenantName}}</td>
                        <td>{{location.sequence}}</td>
                        <td>{{location.status}}</td>
                        <td>
                            <a ng-click="delete(location.id)">Delete</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="grid-parent grid-100 container">
            <unis-pager total-count="locations.length" page-size="pageSize" load-content="loadContent(currentPage)"></unis-pager>
        </div>

        <div class="grid-parent grid-100 container">
            <waitting-btn btn-type="submit" btn-class="grid-10 ripplelink pull-right button-between" value="submitLabel" is-loading="loading"></waitting-btn>
            <button type="button" class="grid-10 ripplelink pull-right cancel" ng-click="cancel(editForm)">Cancel</button>
        </div>
    </form>
</div>